/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.itriage.hospital.test.services;

import com.itriage.hospital.model.Ward;
import com.itriage.hospital.services.WardService;
import java.util.List;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import static org.testng.Assert.*;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/**
 *
 * @author Yandiswa
 */
public class WardTestService {
    private static ApplicationContext ctx;
    WardService wardService;
    public WardTestService() {
    }
    

    @BeforeClass
    public static void setUpClass() throws Exception {
         ctx = new ClassPathXmlApplicationContext("classpath:com/itriage/hospital/app/conf/applicationContext-*.xml");
   
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @BeforeMethod
    public void setUpMethod() throws Exception {
    }

    @AfterMethod
    public void tearDownMethod() throws Exception {
    }
    
    @Test
     public void mytest(){
          wardService = (WardService)ctx.getBean("wardServiceImpl");
       List<Ward> wards = wardService.findAllWards();
       
       for(Ward myWard:wards)
       {
           System.out.println("Department name: "+myWard.getGender());
       }
       List<Ward> myward = wardService.findByAndGendStatus("Empty");
       for(Ward myWard:wards)
        {
         System.out.println("Department name: "+myWard.getWardStatus());
        }
    }
}